
package com.srcptit.java.tranning.hoangdd.btvn1;

import java.util.Scanner;

public class Bai2Muc1{
	public static int UCLN(int a, int b){
		int c;
		while(b>0){
			a=a%b;
			c=a;
			a=b;
			b=c;
		}
		return a;
		
	}
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		System.out.print(" Nhap 2 so nguyen duong a va b = ");
		int a = sc.nextInt();
		int b = sc.nextInt();
		System.out.print(UCLN(a,b)+ " la uoc chung lon nhat cua " +a+ " va " +b);
	}
}
